/**
 * 
 */
package pl.kaczanowscy.tomek.ipdl;

/**
 * A basic implementation of {@link GameSettings} that uses
 * {@link ClassicGameMatrix}.
 * 
 * @author Tomek Kaczanowski
 * 
 */
public final class ClassicGameSettings implements GameSettings {

	private int nbOfRounds;

	/**
	 * How many rounds will be played during a single game of prisoner's
	 * dilemma.
	 * 
	 * @param nbOfRounds
	 *            nb of rounds played
	 */
	public ClassicGameSettings(int nbOfRounds) {
		if (nbOfRounds < 1) {
			throw new IllegalArgumentException(
					"nb of rounds must be > 0, but was " + nbOfRounds);
		}
		this.nbOfRounds = nbOfRounds;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see pl.kaczanowscy.tomek.ipdl.test.GameSettings#getNbOfRounds()
	 */
	@Override
	public int getNbOfRounds() {
		return nbOfRounds;
	}

	/**
	 * Returns {@link ClassicGameMatrix}.
	 * 
	 * @see pl.kaczanowscy.tomek.ipdl.GameSettings#getGameMatrix()
	 */
	public GameMatrix getGameMatrix() {
		return ClassicGameMatrix.getInstance();
	}

}
